<template>
  <a-breadcrumb class="custom-breadcrumb">
    <a-breadcrumb-item v-for="(item, index) in items" :key="index">
      <a href="/" v-if="index === 0">{{ item }}</a>
      <a href="javascript:;" v-else>{{ item }}</a>
    </a-breadcrumb-item>
  </a-breadcrumb>
</template>

<script>
export default {
  computed: {
    items() {
      if (this.$route.meta && this.$route.meta.breadcrumb) {
        let arrays = ["首页"];
        return arrays.concat(this.$route.meta.breadcrumb);
      }
      return [];
    },
  },
};
</script>

<style>
.custom-breadcrumb {
  display: inline-block;
}
</style>
